package com.haoziqi.chapter_02;

import org.apache.flink.runtime.metrics.groups.GenericValueMetricGroup;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * description
 * created by A on 2021/3/4
 */
public class FileSource {
    public static void main(String[] args) throws Exception {
        //1.创建环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.readTextFile("input").print();
        /*
            也可以是文件也可以是目录，
            如果填写HDFS路径，需要导入以下依赖
            <dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-client</artifactId>
    <version>3.1.3</version>
    <scope>provided</scope>
</dependency>

         */
        //提交任务
        env.execute();
    }
}
